<script type="text/javascript">
    contestapp.unlikeimg = "<?php echo $this->config['template_url'];?>assets/img/810/votedbutton.png";
</script>
<div class="w382 mc p10b">
    <div class="w382 b1b" style="margin-bottom: 8px;">
        <table cellpadding="0" cellspacing="5" width="388" align="center">
            <tr>
                <td id="like-area-<?php echo $view->comment['data_id']; ?>" width="90" align="left" valign="middle" style="vertical-align: middle;">
                <?php if(!$view->isEndOfContest) { ?>
                    <?php if($view->isLogined && ($view->comment['is_liked'] > 0)){ ?>
                        <a href="javascript:contestapp.unlikecomment(<?php echo $view->comment['data_id']; ?>)">
                            <img src="<?php echo $this->config['template_url'];?>assets/img/810/votedbutton.png" alt="" />
                        </a>
                    <?php } else { ?>
                        <a href="javascript:contestapp.likecomment(<?php echo $view->comment['data_id']; ?>)">
                            <img src="<?php echo $this->config['template_url'];?>assets/img/810/votebutton.png" alt="" />
                        </a>
                    <?php } ?>    
                <?php } ?>        
                </td>                                
                <?php 
                $voteText = "stemme";
                if($view->comment['total_like'] != 1) {
                    $voteText = "stemmer";
                }
                ?>
                <td width="182" align="left" valign="middle" style="vertical-align: middle;"><b><span id="number-of-like-<?php echo $view->comment['data_id']; ?>" style="font-size:16px;"><?php echo $view->comment['total_like'];?> <?php echo $voteText;?></span></b></td>
                <td width="100">
                    <div style="margin-top: -38px;padding-top: 8px; padding-left: 8px; width: 90px; height: 85px;background-image: url('<?php echo $this->config['template_url'];?>assets/img/810/avatarboder.png');">
                        <div style="overflow: hidden; height: 78px; width: 84px;">
                            <a target="_blank" href="http://www.facebook.com/profile.php?id=<?php echo $view->comment['facebook_user_id']; ?>">
                                <img style="width: 83px;" src="<?php echo $view->comment['facebook_user_picture'];?>" alt="" />
                            </a>
                        </div>
                    </div>                    
                </td>
            </tr>
        </table>

    </div>
    <div class="mc" style="width:380px;">       
        <div style="width:100%;">
            <div style="float:right;">
                <a href="javascript:facebooktab.share();"><img src="images/facebook_button.png" style="width: 60px;" /></a>
                
                <?php 
                    $likeURL = $view->config['lightbox_like_url'] . "&data_id=" . $view->comment['data_id'];                    
                ?>
                
                <iframe src="//www.facebook.com/plugins/like.php?href=<?php echo urlencode($likeURL); ?>&amp;send=false&amp;layout=button_count&amp;width=90&amp;show_faces=false&amp;action=like&amp;colorscheme=light&amp;font&amp;height=20" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:90px; height:20px;" allowTransparency="true"></iframe>
            </div>
        </div>
        
        <!-- start new field UI -->
        <?php echo $view->formHTML; ?>
        <!-- end of new field UI -->
       <br/>
        <table style="width: 65px;margin-bottom: -31px;margin-left: 10px;">
            <tr>
                
                <td width="32" align="left" valign="middle" style="vertical-align: middle;">
                    <a href="javascript:facebooktab.showLikeLightbox(<?php echo $view->preID; ?>);">
                        <img src="<?php echo $this->config['template_url'];?>assets/img/810/pre.png" alt="" />
                    </a>
                </td>
                
                <td width="32" align="right" valign="middle" style="vertical-align: middle;">
                    <a href="javascript:facebooktab.showLikeLightbox(<?php echo $view->nextID; ?>);">
                        <img src="<?php echo $this->config['template_url'];?>assets/img/810/next.png" alt="" />
                    </a>
                </td>
            </tr>
        </table>

    </div>
</div>

<!-- set facebook share data -->

<script type="text/javascript">       
    
    // change the next and pre id of key
    facebooktab.likeboxNextID = <?php echo $view->nextID; ?>;
    facebooktab.likeboxPreID = <?php echo $view->preID; ?>;
    // change the title of lightbox
    jQuery(".lightfaceTitle").html("Bidrag fra <?php echo $view->comment['name'];?>");
    
    // set up share data
     // set up share data
   facebooktab.setFacebookShareData({
        picture:'<?php echo $view->contest['share_image']; ?>',
        name:'<?php echo $view->contest['share_title']; ?>',
        caption:'<?php echo $view->contest['share_text']; ?>',
        url:'<?php echo $view->config['facebooktab_share_url'] . "&app_data=" . $view->comment['data_id']; ?>',
        actionText:'<?php echo $view->contest['share_action_text']; ?>'
    });       
    
</script>